home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / GrowBoxDock / Sources / AGFile.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-30  |  6.1 KB  |  173 lines

  1. /*
  2.     File:        AGFile.h
  3.  
  4.     Contains:    Public interface to Apple Guide Database Files.
  5.                 Does not use or require the Apple Guide extension.
  6.  
  7.     Version:    Mac OS X
  8.  
  9.     Disclaimer:    IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
  10.                 ("Apple") in consideration of your agreement to the following terms, and your
  11.                 use, installation, modification or redistribution of this Apple software
  12.                 constitutes acceptance of these terms.  If you do not agree with these terms,
  13.                 please do not use, install, modify or redistribute this Apple software.
  14.  
  15.                 In consideration of your agreement to abide by the following terms, and subject
  16.                 to these terms, Apple grants you a personal, non-exclusive license, under Apple’s
  17.                 copyrights in this original Apple software (the "Apple Software"), to use,
  18.                 reproduce, modify and redistribute the Apple Software, with or without
  19.                 modifications, in source and/or binary forms; provided that if you redistribute
  20.                 the Apple Software in its entirety and without modifications, you must retain
  21.                 this notice and the following text and disclaimers in all such redistributions of
  22.                 the Apple Software.  Neither the name, trademarks, service marks or logos of
  23.                 Apple Computer, Inc. may be used to endorse or promote products derived from the
  24.                 Apple Software without specific prior written permission from Apple.  Except as
  25.                 expressly stated in this notice, no other rights or licenses, express or implied,
  26.                 are granted by Apple herein, including but not limited to any patent rights that
  27.                 may be infringed by your derivative works or by other works in which the Apple
  28.                 Software may be incorporated.
  29.  
  30.                 The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
  31.                 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
  32.                 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  33.                 PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
  34.                 COMBINATION WITH YOUR PRODUCTS.
  35.  
  36.                 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
  37.                 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  38.                 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  39.                 ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
  40.                 OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
  41.                 (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
  42.                 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  43.  
  44.     Copyright © 1994-2001 Apple Computer, Inc., All Rights Reserved
  45. */
  46.  
  47. #ifndef __AGFILE__
  48. #define __AGFILE__
  49.  
  50. #if defined(USE_UMBRELLA_HEADERS) && USE_UMBRELLA_HEADERS
  51.         #include <Carbon.h>
  52. #else
  53.     #include <Files.h>
  54.     #include <MacTypes.h>
  55. #endif
  56.  
  57.             // typedef's
  58.  
  59. typedef FSSpec AGFileFSSpecType;
  60. typedef short AGFileSelectorCountType;
  61. typedef short AGFileSelectorIndexType;
  62. typedef OSType AGFileSelectorType;
  63. typedef long AGFileSelectorValueType;
  64. typedef short AGFileDBType;
  65. typedef ConstStr63Param AGFileDBMenuNamePtr;
  66. typedef short AGFileDBScriptType;
  67. typedef short AGFileDBRegionType;
  68. typedef short AGFileMajorRevType;
  69. typedef short AGFileMinorRevType;
  70. typedef short AGFileCountType;
  71.  
  72.             // Database types (for AGFileDBType parameter).
  73.  
  74. enum
  75. {
  76.     kAGFileDBTypeAny =            0,
  77.     kAGFileDBTypeHelp =            1,
  78.     kAGFileDBTypeTutorial =        2,
  79.     kAGFileDBTypeShortcuts =    3,
  80.     kAGFileDBTypeAbout =        4,
  81.     kAGFileDBTypeOther =        8
  82. };
  83.  
  84.             // Functions.
  85.  
  86.         // Get the database menu item name.
  87. pascal OSErr
  88. AGFileGetDBMenuName(AGFileFSSpecType *fileSpec,
  89.                     AGFileDBMenuNamePtr menuItemNameString);
  90.  
  91.         // Get the database type.
  92. pascal OSErr
  93. AGFileGetDBType(AGFileFSSpecType *fileSpec,
  94.                 AGFileDBType *databaseType);
  95.  
  96.         // Get the version of the software
  97.         // that created this database.
  98. pascal OSErr
  99. AGFileGetDBVersion(AGFileFSSpecType *fileSpec,
  100.                     AGFileMajorRevType *majorRev,
  101.                     AGFileMinorRevType *minorRev);
  102.  
  103.         // Get the database script and region information.
  104. pascal OSErr
  105. AGFileGetDBCountry(AGFileFSSpecType *fileSpec,
  106.                     AGFileDBScriptType *script,
  107.                     AGFileDBRegionType *region);
  108.  
  109.         // Return the number of selectors in database.
  110. pascal AGFileSelectorCountType
  111. AGFileGetSelectorCount(AGFileFSSpecType *fileSpec);
  112.  
  113.         // Get the i-th database selector (1 to AGFileSelectorCountType)
  114.         // and its value.
  115. pascal OSErr
  116. AGFileGetSelector(AGFileFSSpecType *fileSpec,
  117.                     AGFileSelectorIndexType selectorNumber,
  118.                     AGFileSelectorType *selector,
  119.                     AGFileSelectorValueType *value);
  120.  
  121.         // Return true if database is mixin.
  122. pascal Boolean
  123. AGFileIsMixin(AGFileFSSpecType *fileSpec);
  124.  
  125.         // Return the number of database files
  126.         // of the specified databaseType and main/mixin.
  127.         // Any file creator is acceptible,
  128.         // but type must be kAGFileMain or kAGFileMixin.
  129. pascal AGFileCountType
  130. AGFileGetDBCount(short vRefNum,
  131.                     long dirID,
  132.                     AGFileDBType databaseType,
  133.                     Boolean wantMixin);
  134.  
  135.         // Get the FSSpec for the dbIndex-th database
  136.         // of the specified databaseType and main/mixin.
  137.         // Any file creator is acceptible,
  138.         // but type must be kAGFileMain or kAGFileMixin.
  139. pascal OSErr
  140. AGFileGetIndDB(short vRefNum,
  141.                 long dirID,
  142.                 AGFileDBType databaseType,
  143.                 Boolean wantMixin,
  144.                 short dbIndex,
  145.                 FSSpec *fileSpec);
  146.  
  147.         // This selector must match with the application
  148.         // creator in order for this file to appear in the 
  149.         // application's Help menu. Ignored for mixin files
  150.         // because they never appear in the Help menu anyway.
  151.         // If empty (zeros), will appear in the Help menu
  152.         // of any host application.
  153. pascal OSErr
  154. AGFileGetHelpMenuAppCreator(AGFileFSSpecType *fileSpec,
  155.                                 OSType *helpMenuAppCreator);
  156.  
  157.         // This selector must match in the main and mixin
  158.         // files in order for the mixin to mix-in with the main.
  159.         // Empty (zeros) selectors are valid matches.
  160.         // A '****' selector will mix-in with any main.
  161. pascal OSErr
  162. AGFileGetMixinMatchSelector(AGFileFSSpecType *fileSpec,
  163.                                 OSType *mixinMatchSelector);
  164.  
  165.         // This is the text of the balloon for the
  166.         // Help menu item for this database.
  167. pascal OSErr
  168. AGFileGetHelpMenuBalloonText(AGFileFSSpecType *fileSpec,
  169.                                 Str255 helpMenuBalloonString);
  170.  
  171. #endif /* __AGFILE__ */
  172.  
  173.